package com.smart.draw.plantuml.controllers;

import com.smart.draw.plantuml.service.TranscoderService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author xiaoqiang
 * @Version TranscoderController.java, v 0.1 2025年08月26日 16:54 xiaoqiang
 * @Description: TODO
 */
@RestController
@RequestMapping("/app/transcoder")
public class TranscoderController {

    private final TranscoderService transcoderService;

    public TranscoderController(TranscoderService transcoderService) {
        this.transcoderService = transcoderService;
    }

    @PostMapping("encode")
    public String encode(@RequestParam("data") String data) {
        return transcoderService.encode(data);
    }

    @PostMapping("decode")
    public String decode(@RequestParam("data") String data) {
        return transcoderService.decode(data);
    }

}
